function [x,y,typ] = phaseShifter_int(job,arg1,arg2)

	x=[];y=[];typ=[]
	
	select job
		case 'plot' then
  			standard_draw(arg1)
		case 'getinputs' then
  			[x,y,typ]=standard_inputs(arg1)
		case 'getoutputs' then
  			[x,y,typ]=standard_outputs(arg1)
		case 'getorigin' then
  			[x,y]=standard_origin(arg1)
		case 'set' then
			//set the parameters of the hilbertTransformer
			//size of input (or output, must be a positive even integer): 
			//phase shift(in degree)
			x=arg1;
			graphics=arg1.graphics;model=arg1.model;
			exprs=graphics.exprs;
			
			while %t do
				//get parameters
				[ok,num, phaseShift, exprs]=getvalue('Scicom  Phase Shifter block',...
				['size of input (or output, must be a positive even integer)';...
				'phase shift(in degree)';],...
				list('vec',1,'vec',1),exprs)
				
				if ~ok then break,end;
				
				//check validity of parameters
				if (modulo(num, 2) ~= 0) | (num <= 0) then
					message('size of input must be a positive even integer')
					ok = %f;
				end

				//write back parameters
				if ok then
					graphics.exprs=exprs
					model.in=num; 
					model.out=num
					model.rpar = [phaseShift];
					model.dstate = zeros(num,1);
					x.graphics=graphics;x.model=model
					break;
				end
			end
		case 'define' then
			num = 64;
			phaseShift = 90;
  			exprs=[string(num); string(phaseShift)];
  			model=scicos_model()
  			model.sim=list('phaseShifter_com',5)
  			model.evtin = [1];
  			model.in=num
  			model.out=num
  			model.rpar = [phaseShift];
  			model.dstate = zeros(num,1);
  			model.blocktype='d'
  			model.dep_ut=[%f %t]
  			gr_i=['xstringb(orig(1),orig(2),[''Phase'';''Shifter''],sz(1),sz(2),''fill'')']
  			x=standard_define([2.5 2.5],model,exprs,gr_i)
	end
endfunction
